//
//  LSWorkDayReportTableViewCell.m
//  LaSaCivilAffairsDepartment
//
//  Created by 聂志康 on 2018/12/24.
//  Copyright © 2018 wpkj. All rights reserved.
//

#import "LSWorkDayReportTableViewCell.h"

@interface LSWorkDayReportTableViewCell ()
@property (nonatomic, strong) UILabel *mainTitleLabel;
@property (nonatomic, strong) UILabel *timeLabel;
@property (nonatomic, strong) UILabel *stateLabel;
@end

@implementation LSWorkDayReportTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self.contentView addSubview:self.mainTitleLabel];
        [self.contentView addSubview:self.timeLabel];
        [self.contentView addSubview:self.stateLabel];
    }
    return self;
}

- (void)setMainTitleText:(NSString *)mainTitleText {
    _mainTitleText = mainTitleText;
    self.mainTitleLabel.text = mainTitleText;
}

- (void)setTimeText:(NSString *)timeText {
    _timeText = timeText;
    self.timeLabel.text = timeText;
}

- (void)setStateText:(NSString *)stateText {
    _stateText = stateText;
    self.stateLabel.text = stateText;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    WS
    [self.mainTitleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakSelf.contentView.mas_left).with.offset(15);
        make.top.equalTo(weakSelf.contentView.mas_top).with.offset(10);
    }];
    [self.timeLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakSelf.contentView.mas_left).with.offset(15);
        make.top.equalTo(weakSelf.contentView.mas_top).with.offset(30);
    }];
    [self.stateLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(weakSelf.contentView.mas_right).with.offset(-15);
        make.top.equalTo(weakSelf.contentView.mas_top).with.offset(10);
        make.left.equalTo(weakSelf.mainTitleLabel.mas_right).with.offset(10);
    }];
}

- (UILabel *)mainTitleLabel {
    if (!_mainTitleLabel) {
        _mainTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 15, ScreenWidth-30, 10)];
        _mainTitleLabel.font = [UIFont fontWithName:@"SourceHanSansCN-Regular" size:14];
        _mainTitleLabel.textColor = hexColor(333333);
    }
    return _mainTitleLabel;
}

- (UILabel *)timeLabel {
    if (!_timeLabel) {
        _timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 30, ScreenWidth-30, 9)];
        _timeLabel.font = [UIFont fontWithName:@"SourceHanSansCN-Regular" size:12];
        _timeLabel.textColor = hexColor(333333);
    }
    return _timeLabel;
}

- (UILabel *)stateLabel {
    if (!_stateLabel) {
        _stateLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 30, ScreenWidth-30, 9)];
        _stateLabel.font = [UIFont fontWithName:@"SourceHanSansCN-Regular" size:12];
        _stateLabel.textColor = hexColor(E32223);
        _stateLabel.textAlignment = NSTextAlignmentRight;
    }
    return _stateLabel;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
